$(function() {
    // 获取地址栏中的查询字符串
    function getparams(currentId) {
        var arr = decodeURI(location.search).split("?");
        var arrU = arr[1].split("&");
        var obj = {};
        var pageId = currentId;
        for (var i = 0; i < arrU.length; i++) {
            var arrur = arrU[i].split("=");
            obj[arrur[0]] = arrur[1];
        }
        $.ajax({
            type: 'get',
            url: 'http://localhost:3000/api/getdiscountproduct',
            data: {
                productid: obj.productid
            },
            dataType: 'json',
            success: function(res) {
                var obj2 = {};
                // var Arr = [];
                // Arr[0] = res.result;
                obj2 = { prolist: [res.result] }
                console.log(obj2);
                $(".china-box").html(template("money-product-list", obj2))
            }
        })
    }
    getparams()
})